package com.huterox.todoscheduler.core.wapper;

import com.huterox.todoscheduler.core.enumType.TodoItemElementType;

import java.io.Serializable;
import java.lang.reflect.Method;

/**
 * 将对应的方法和类存储起来，主要是为了创建模板
 * */
public class TodoItemMethodWrapper implements Serializable {

    private Object wrapperInstance;
    private Class<?> wrapperClass;
    private Method wrapperMethod;
    private TodoItemElementType todoItemElementType;
    //这个是第几个清单项的方法
    private int idx;

    //这个方法执行的序号是多少
    private int order;

    public TodoItemMethodWrapper() {
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public int getIdx() {
        return idx;
    }

    public void setIdx(int idx) {
        this.idx = idx;
    }

    public void setWrapperInstance(Object wrapperInstance) {
        this.wrapperInstance = wrapperInstance;
    }

    public TodoItemElementType getTodoItemElementType() {
        return todoItemElementType;
    }

    public void setTodoItemElementType(TodoItemElementType todoItemElementType) {
        this.todoItemElementType = todoItemElementType;
    }

    public void setWrapperClass(Class<?> wrapperClass) {
        this.wrapperClass = wrapperClass;
    }

    public Method getWrapperMethod() {
        return wrapperMethod;
    }

    public void setWrapperMethod(Method wrapperMethod) {
        this.wrapperMethod = wrapperMethod;
    }

    public TodoItemMethodWrapper(Object instance) {
        this.wrapperInstance = instance;
        this.wrapperClass = this.wrapperInstance.getClass();
    }

    public Object getWrapperInstance() {
        return wrapperInstance;
    }

    public Class<?> getWrapperClass() {
        return wrapperClass;
    }
}
